package com.yan.service.serviceImpl;

import com.yan.dao.StudentMapper;
import com.yan.dao.TeacherMapper;
import com.yan.pojo.Student;
import com.yan.pojo.Teacher;
import com.yan.service.AdminService;

import java.util.List;

public class AdminServiceImpl implements AdminService {

    private StudentMapper studentMapper;
    private TeacherMapper teacherMapper;
    public void setStudentDao(StudentMapper studentMapper) {
        this.studentMapper = studentMapper;
    }
    public void setTeacherDao(TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }

    @Override
    public List<Student> studentList() {
        return studentMapper.studentList();
    }

    @Override
    public Student getStudentById(Integer studentId) {
        return studentMapper.getStudentById(studentId);
    }

    @Override
    public boolean addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public boolean addTeacher(Teacher teacher) {
        return teacherMapper.addTeacher(teacher);
    }

    @Override
    public boolean delTeacherById(Integer id) {
        return teacherMapper.delTeacherById(id);
    }

    @Override
    public boolean updateStudent00(Student student) {
        return studentMapper.updateStudent00(student);
    }

    @Override
    public boolean delStudentByStudentId(Integer studentId) {
        return studentMapper.delStudentByStudentId(studentId);
    }

    @Override
    public boolean updateStudentPassword(Integer studentId, String newPassword) {
        return studentMapper.updatePassword(studentId, newPassword);
    }

    @Override
    public boolean updateTeacherPassword(Teacher teacher) {
        return teacherMapper.updatePassword(teacher);
    }

    @Override
    public boolean saveEditTeacher(Teacher teacher) {
        return teacherMapper.saveEditTeacher(teacher);
    }

    @Override
    public List<Student> findStudent(String keyWords) {
        return studentMapper.findStudent(keyWords);
    }

    @Override
    public List<Student> getStudentsBeDeleted() {
        return studentMapper.getStudentsBeDeleted();
    }

    @Override
    public boolean clearAllDelete() {
        return studentMapper.clearAllDelete();
    }

}
